# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-protego
pkgver=0.2.1
pkgrel=2
pkgdesc="A pure-Python robots.txt parser with support for modern conventions"
url="https://github.com/scrapy/protego"
license=('BSD')
arch=('any')
depends=('python-six')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner')
source=("$pkgname-$pkgver.tar.gz::https://github.com/scrapy/protego/archive/$pkgver.tar.gz")
sha512sums=('ef8a8196d8ece577eec90cc2e2cca2899625bd777c18f01c8e72a6130d4c2c13f71fa6e32a3e8e43b749f7556f4e3dbb1662e5e94ae18e6c8a7eef950779be1b')

build() {
  cd protego-$pkgver
  python setup.py build
}

check() {
  cd protego-$pkgver
  python setup.py pytest
}

package() {
  cd protego-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
